package com.toaa.crazymath;

import android.content.Intent;
import android.os.Bundle;

import com.startapp.android.publish.StartAppSDK;
import com.startapp.android.publish.StartAppAd.AdMode;

public class SplashActivity extends BaseAdsActivity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		// handle case that user pressed OPEN button after installing app
		if (!isTaskRoot()) {
			final Intent intent = getIntent();
			final String intentAction = intent.getAction();
			if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && intentAction != null
					&& intentAction.equals(Intent.ACTION_MAIN)) {
				finish();
				return;
			}
		}
		
		StartAppSDK.init(this, Constant.STARTAPP_PUBLISHER_ID, Constant.STARTAPP_APP_ID, true);
		startActivity(new Intent(this, MainActivity.class));
		showInterstitialAd(AdMode.AUTOMATIC);
		finish();
		
	}
	

}
